<?php
include("../lib/template.inc");
include("../lib/lib_online_payment.php");
include("../nav_data.php");
$m=0;

$user=get_current_user_obj();
$receiver=new receiver($user->epsn,$user->user_ID);

if(islogedin())
{	
	$pa=$receiver->get_pays_to_me();
	if(count($pa)==0)
	{
		$doc[$m]["title"]="无款项";
		$doc[$m]["content"]='您当前尚无付入款项。';
		$doc[$m]["wid"]='100%';
	}
	else
	{
		foreach($pa as $payment)
		{
			$doc[$m]["processor"]="receive_pay.php";
			$doc[$m]["submit_name"]="收款";
			$doc[$m]["title"]="款项";
			$doc[$m]["content"]='
			支付者:'.$payment["payer_name"].'<br />
			支付备注:'.$payment["pay_memo"].'<br />
			支付金额:'.$payment["amount"].'<br />
			<input type="hidden" name="pay_info" value="'.$payment["pay_info"].'">
			';
			$doc[$m]["wid"]='100%';
			$m++;
		}
	}
}	
else
{
	$doc[$m]["title"]="网上收款";
	$doc[$m]["content"]='您尚未登录，请您点击<a href="../user_login.php">这里</a>登录';
	$doc[$m]["wid"]='100%';
}
	
include("render.php");
render("网上付款",$nav_title,$nav_link,$doc);
?>